<script setup>

import { useRoute } from 'vue-router';
const route = useRoute()

console.log(route.meta.cache)

</script>

<template>

<!-- 
<keep-alive>
	  <router-view></router-view>
</keep-alive> -->



<router-view v-slot="{ Component }">
	
	<!-- 不缓存 放这 -->
  <component  v-if="!route.meta.cache"  :is="Component" />

  <!-- 缓存 -->
  <keep-alive>
    <component v-if="route.meta.cache"  :is="Component" :key="route.meta.path" />
  </keep-alive>
  
</router-view>



</template>

<style scoped></style>
